SftTree/NET 2.0

Width Property, ColumnClass Class

Softel vdm, Inc.

Defines the column's width, adjusting for open-ended columns.

Syntax      ColumnClass Class (Softelvdm.SftTreeNET)

VB   

Public Property Width As Integer

C#   

public int Width { get; set; }

C++   

public: property int Width {
        int get();
        void set(int value);
}

Property Value

The width in pixels.

The default value is 100.

Comments

The Width property defines the column's width, adjusting for open-ended columns.

The Width property determines the width of the column, including any additional space allocated to an open-ended last column (see Columns.LastOpenended). When an open-ended last column is used, the width of the space available to the column can be larger. An open-ended column will always use the space remaining between the previous column and the right edge of the tree control window.

The _Width property returns the last width assigned to the Width property.

When updating a column's width, the HorizontalExtent (and HorizontalExtentRight) property is automatically updated to match the new width.

Due to the variable number of levels and the resulting hierarchical display, the width of the first column is always treated as a minimum width. The cells in the hierarchy column will always be at least of the specified width, no matter what level the item is on. This can result in the first column being much wider than the defined width. To calculate the actual width of hierarchy column, add the value returned by the OverheadWidth property to the value returned by hierarchy column's Width property.

The ColumnClass.GetOptimalWidth or ColumnClass.MakeOptimal methods can be used to calculate or define the optimal width for a column. An optimal width allows all cell contents in a column to be displayed in their entirety, without being clipped.


Feedback / comments / error reports for this topic
© 2007 - Softel vdm, Inc. - www.softelvdm.com